import world
import network

def main():
    w = world.World()
    #w.send_chan = stackless.channel()
    #network.start("localhost", 26734, w.channel, w.send_chan, "Bob", "Hadoken")
    world.main(w)

def login():
    import socket
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    #sock.bind(("localhost", 45988))
    sock.connect(("localhost", 25673))
    sock.send("join")

def change_to_correct_path():
    import os
    import sys
    exe_base_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
    os.chdir(exe_base_dir)
    sys.path.append(exe_base_dir)

if __name__ == "__main__":
    change_to_correct_path()
    #stackless.tasklet(main)()
    main()
    #stackless.run()
